﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TapTapServer
{
    static public class zipManager
    {
        static public bool addFilesToNewZip(string PathToZipFile, string DirToAdd)
        {
            if (!PathToZipFile.ToLower().EndsWith(".zip"))
            {
                throw new Exception("Attempted to add files to non-.zip path");
            }

            Ionic.Zip.ZipFile zipFile = new Ionic.Zip.ZipFile();
            zipFile.AddDirectory(DirToAdd);
            zipFile.Save(PathToZipFile);

            return true;
        }
    }
}
